package com.example.boot1.filterInterceptor;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(filterName = "bulkFilter",urlPatterns = "/*")
public class BulkFilter1 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("BulkFilter1 init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("BulkFilter1 doFilter 进入方法前");
        filterChain.doFilter(servletRequest,servletResponse);
        System.out.println("BulkFilter1 doFilter 进入方法后");
    }

    @Override
    public void destroy() {
        System.out.println("BulkFilter1 destroy");
    }
}
